<?php require_once($_SERVER['DOCUMENT_ROOT']."/defaultconf.mex");
require_once($_SERVER['DOCUMENT_ROOT']."/Modules/MGK20XF5/moduleconf.php");
MYDCONN();
if (isset($_POST['Ref'])) {
	$GET[1]['Ref'] = $_POST['Ref'];
}
if (isset($_GET['Ref']) ) {
	$GET[1]['Ref'] = $_GET['Ref'];
	if (!isset($_GET['lock'])) {
	echo '<script charset="utf-8" type="text/javascript">setTimeout(replaceUrl(\'list_files\',\''.$MODURL.'lib/list_showfiles.php?lock=1&Ref='.$GET[1]['Ref'].'\'),5000);</script>';
	}
}
$Files = $GLOBALS['MYD']->db_array("SELECT FILE, REF FROM doccenter_files WHERE DOC = {$GET[1]['Ref']}"); 
	for ($g = 1; $g<= $Files[0]; $g++) {
		mn_field('button','ED','DELFILE','Apagar anexo','','','','" onclick="
			document.DocEdit.selected.value='.$Files[$g]['REF'].';
			subform(\'DocEdit\',\'list_files\');');
			echo ' '.$Files[$g]['FILE']; echo '<br/>';
	}
